<?php include('header.php');?>
<div class="container-fluid">
	<div class="row-fluid">
		<div class="span 12">
			<h1>ADMIN</h1>
		</div>
	</div>
	<div class="row-fluid">
		<div class="span2"">
			<?php include('lefter.php');?>
		</div>
		<div class="span10">
			<div class="row-fluid">
				<div class="span8">
					<h3>
						<span>PAGEVIEW</span>
					</h3>
				</div>
				<div class="span4">
					<div class="btn-group btn-limit pull-right" data-toggle="buttons-radio">
						<button type="button" class="btn<?php if($limit == 10) :?> active<?php endif;?>">
							<i class="icon-resize-vertical"></i>10
						</button>
						<button type="button" class="btn<?php if($limit == 20) :?> active<?php endif;?>">
							<i class="icon-resize-vertical"></i>20
						</button>
						<button type="button" class="btn<?php if($limit == 50) :?> active<?php endif;?>">
							<i class="icon-resize-vertical"></i>50
						</button>
					</div>
				</div>
			</div>
			<hr />
			<table class="table">
				<thead>
					<tr>
						<th>date</th>
						<?php for($i=0; $i<=23; $i ++) :?>
						<th class="hidden-phone"><?=sprintf('%02d',$i)?></td>
						<?php endfor;?>
						<th>total</th>
					</tr>
				</thead>
				<tbody>
				<?php foreach($pageview_rows as $row) :?>
					<tr>
						<td><?=$row['date']?></td>
						<?php for($i=0; $i<=23; $i ++) :?>
						<td class="hidden-phone"><?=number_format($row['count_'.$i])?></td>
						<?php endfor;?>
						<td><?=number_format($row['total'])?></td>
					</tr>
				<?php endforeach;?>
				</tbody>
			</table>
			<div class="pagination pagination-centered">
				<ul>
					<?=$pagination_links?>
				</ul>
			</div>
		</div>
	</div>
</div>
<script src="<?=JS_DIR?>/jquery-1.8.3.min.js"></script>
<script src="<?=JS_DIR?>/respond.min.js"></script>
<script src="<?=BS_DIR?>/admin/js/bootstrap.min.js"></script>
<script>
$(function() {
	$("div.btn-limit button").click(function() {
		location.href = "<?=base_url(CONTROLLER.'/'.METHOD)?>/"+$(this).text()+"/";
	});		
});
</script>
<?php include('footer.php');?>